#ifndef MQ2_H
#define MQ2_H

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include <stdio.h>

/* Exported types ------------------------------------------------------------*/


/* Exported constants --------------------------------------------------------*/  
#define MQ2_AO_PORT			GPIOA
#define MQ2_AO_PIN			GPIO_Pin_1
#define MQ2_AO_CLK			RCC_APB2Periph_GPIOA

#define MQ2_ADC				ADC1
#define MQ2_ADC_CHANNEL		ADC_Channel_1
#define MQ2_ADC_CLK			RCC_APB2Periph_ADC1
#define MQ2_ADC_CLK_INIT	RCC_APB2PeriphClockCmd

/* Exported macro ------------------------------------------------------------*/
/* Exported variables ---------------------------------------------------------*/
extern int smoke_gasppm;

/* Exported functions ------------------------------------------------------- */
void mq2_init(void);
uint16_t mq2_getppm(void);

#endif

